%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/connections/pagination-before-last-pagination-only"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 11, 12, 26, 27, 28, 13, 16, 17<br />2: PgSelect[10], PgSelect[19]<br />3: Connection[14], PgSelectRows[21]<br />ᐳ: 20, 22, 23"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 14, 23<br /><br />ROOT Connectionᐸ10ᐳ[14]"):::bucket
    end
    Bucket0 --> Bucket1

    %% plan dependencies
    PgSelect10[["PgSelect[10∈0] ➊<br />ᐸmessages+1ᐳ<br />More deps:<br />- Constantᐸ3ᐳ[27]"]]:::plan
    Object13{{"Object[13∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Lambda16{{"Lambda[16∈0] ➊<br />ᐸincludeArchivedConditionᐳ<br />More deps:<br />- Constantᐸ[ undefined, 'INHERIT' ]ᐳ[26]"}}:::plan
    Lambda17{{"Lambda[17∈0] ➊<br />ᐸparseCursorᐳ<br />More deps:<br />- Constantᐸ'WyJmMGIyOGM5NGMxIiwiZjE3MGYxNzAtMDAwMC0wMDAwLTAwMDAtYjBiMDAᐳ[28]"}}:::plan
    Object13 & Lambda16 & Lambda17 --> PgSelect10
    PgSelect19[["PgSelect[19∈0] ➊<br />ᐸmessages(aggregate)ᐳ<br />More deps:<br />- Constantᐸ3ᐳ[27]"]]:::plan
    Object13 & Lambda16 & Lambda17 --> PgSelect19
    Connection14[["Connection[14∈0] ➊<br />ᐸ10ᐳ<br />More deps:<br />- Constantᐸ3ᐳ[27]"]]:::plan
    PgSelect10 & Lambda17 --> Connection14
    Access11{{"Access[11∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access12{{"Access[12∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access11 & Access12 --> Object13
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access11
    __Value2 --> Access12
    First20{{"First[20∈0] ➊"}}:::plan
    PgSelectRows21[["PgSelectRows[21∈0] ➊"]]:::plan
    PgSelectRows21 --> First20
    PgSelect19 --> PgSelectRows21
    PgSelectSingle22{{"PgSelectSingle[22∈0] ➊<br />ᐸmessagesᐳ"}}:::plan
    First20 --> PgSelectSingle22
    PageInfo18{{"PageInfo[18∈1] ➊"}}:::plan
    Connection14 --> PageInfo18
    Access24{{"Access[24∈1] ➊<br />ᐸ14.hasNextPageᐳ"}}:::plan
    PageInfo18 o--o Access24
    Access25{{"Access[25∈1] ➊<br />ᐸ14.hasPreviousPageᐳ"}}:::plan
    Access24 o--o Access25

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect10,Access11,Access12,Object13,Connection14,Lambda16,Lambda17,PgSelect19,First20,PgSelectRows21,PgSelectSingle22 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1,PageInfo18,Access24,Access25 bucket1

